#include <iostream>
#include "Point.h"

Point::Point(int x, int y)
{
    this->x = x;
    this->y = y;
}

Point::~Point()
{
}


int Point::getX()
{
    return this->x;
}

int Point::getY()
{
    return this->y;
}

void Point::print()
{
    //prints pointer e.g. ( 1, 5 )
    cout<< this->x << " " << this->y <<endl;
}


double Point::getDistanceFrom(Point* other){
    //Calculates the distance between this point and another point using formula
    //SquareRoot((P1's_X - P2's_X)^2 + (P1's_Y - P2's_Y)^2)
	return sqrt(pow((double)(getX() - other->getX()),2) + pow((double)(getY() - other->getY()),2));
}

bool Point::equals(Point* p){
    //checks if this point is equal to another point
	if (this == p){
		return true;
	}
	return (this->getX() == p->getX() && this->getY() == p->getY());
}
